package com.pollux.entity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ToString
@EqualsAndHashCode
/**
 * @TableName additional_comment
 */
public class AdditionalComment implements Serializable {

    /**
     * 主键
     */
    @NotNull(message = "[主键]不能为空")
    @Schema(name = "id", description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long id;

    /**
     * 追评时间
     */
    @NotNull(message = "[追评时间]不能为空")
    @Schema(name = "commentTime", description = "追评时间", example = "2023-10-01 12:00:00", type = "string", format = "date-time", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime commentTime;

    /**
     * 用户id
     */
    @NotNull(message = "[用户id]不能为空")
    @Schema(name = "userId", description = "用户id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer userId;

    /**
     * 用户名
     */
    @NotBlank(message = "[用户名]不能为空")
    @Size(max = 15, message = "编码长度不能超过15")
    @Schema(name = "username", description = "用户名", maxLength = 15, requiredMode = Schema.RequiredMode.REQUIRED)
    private String username;

    /**
     * 被评论者名字
     */
    @NotBlank(message = "[被评论者名字]不能为空")
    @Size(max = 15, message = "编码长度不能超过15")
    @Schema(name = "beCommentName", description = "被评论者名字", maxLength = 15, requiredMode = Schema.RequiredMode.REQUIRED)
    private String beCommentName;

    /**
     * 被评论者id
     */
    @NotNull(message = "[被评论者id]不能为空")
    @Schema(name = "beCommentId", description = "被评论者id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer beCommentId;

    /**
     * 追评内容
     */
    @NotBlank(message = "[追评内容]不能为空")
    @Schema(name = "content", description = "追评内容", requiredMode = Schema.RequiredMode.REQUIRED)
    private String content;

    /**
     * 逻辑删除。1为已删除
     */
    @NotNull(message = "[逻辑删除。1为已删除]不能为空")
    @Schema(name = "isDelete", description = "逻辑删除。1为已删除", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer isDelete = 0; // 默认值为0，表示未删除

    /**
     * 记录创建时间
     */
    @NotNull(message = "[记录创建时间]不能为空")
    @Schema(name = "createTime", description = "记录创建时间", example = "2023-10-01 12:00:00", type = "string", format = "date-time", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime createTime = LocalDateTime.now();

    /**
     * 创建人id
     */
    @NotNull(message = "[创建人id]不能为空")
    @Schema(name = "createId", description = "创建人id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer createId;

    /**
     * 最后修改时间
     */
    @NotNull(message = "[最后修改时间]不能为空")
    @Schema(name = "updateTime", description = "最后修改时间", example = "2023-10-01 12:00:00", type = "string", format = "date-time", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime updateTime = LocalDateTime.now();

    /**
     * 最后修改人id
     */
    @NotNull(message = "[最后修改人id]不能为空")
    @Schema(name = "updateId", description = "最后修改人id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer updateId;
}
